﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;
using SharpUpdate;

namespace CLPD_Crime_Calculator
{
    public partial class Form1 : Form, ISharpUpdatable
    {

        bool DisKeep = true;
        bool MisKeep = true;
        bool TisKeep = true;
        bool BisKeep = true;
        bool PisKeep = true;
        bool PisisKeep = true;
        bool RisKeep = true;
        bool DivisKeep = true;
        bool DvisKeep = true;

        bool isDisabledDD = false;
        bool isDisabledDop = false;
        bool isDisabledAll = false;

        bool calcFines = false;

        bool isBeingUsed = false;
        bool calculated = false;

        public float preTime = 0;
        public int preFines = 0;
        public int preTimeI = 0;
        public string preCharges = "";

        Crimes Crimes = new Crimes();

        private SharpUpdater updater;
        


        public Form1()
        {
            InitializeComponent();
            Crimes.initCrimes();

            this.label149.Text = "Version: " + this.ApplicationAssembly.GetName().Version.ToString();
            updater = new SharpUpdater(this);
        }

        private void Calculator_Click(object sender, EventArgs e)
        {

        }

        private void label7_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown6_ValueChanged(object sender, EventArgs e)
        {

        }

        private void label33_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown32_ValueChanged(object sender, EventArgs e)
        {

        }

        private void label56_Click(object sender, EventArgs e)
        {

        }

        private void numericUpDown55_ValueChanged(object sender, EventArgs e)
        {

        }


        #region License Revoke Functions
        private void button1_Click(object sender, EventArgs e)
        {
            if (DisKeep == true)
            {
                button1.ForeColor = System.Drawing.Color.Red;
                button1.Text = "Revoked";
                DisKeep = false;
            }
            else
            {
                button1.ForeColor = System.Drawing.Color.Green;
                button1.Text = "Keep";
                DisKeep = true;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (MisKeep == true)
            {
                button2.ForeColor = System.Drawing.Color.Red;
                button2.Text = "Revoked";
                MisKeep = false;
            }
            else
            {
                button2.ForeColor = System.Drawing.Color.Green;
                button2.Text = "Keep";
                MisKeep = true;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (TisKeep == true)
            {
                button3.ForeColor = System.Drawing.Color.Red;
                button3.Text = "Revoked";
                TisKeep = false;
            }
            else
            {
                button3.ForeColor = System.Drawing.Color.Green;
                button3.Text = "Keep";
                TisKeep = true;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (BisKeep == true)
            {
                button4.ForeColor = System.Drawing.Color.Red;
                button4.Text = "Revoked";
                BisKeep = false;
            }
            else
            {
                button4.ForeColor = System.Drawing.Color.Green;
                button4.Text = "Keep";
                BisKeep = true;
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (PisKeep == true)
            {
                button5.ForeColor = System.Drawing.Color.Red;
                button5.Text = "Revoked";
                PisKeep = false;
            }
            else
            {
                button5.ForeColor = System.Drawing.Color.Green;
                button5.Text = "Keep";
                PisKeep = true;
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (PisisKeep == true)
            {
                button6.ForeColor = System.Drawing.Color.Red;
                button6.Text = "Revoked";
                PisisKeep = false;
            }
            else
            {
                button6.ForeColor = System.Drawing.Color.Green;
                button6.Text = "Keep";
                PisisKeep = true;
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (RisKeep == true)
            {
                button7.ForeColor = System.Drawing.Color.Red;
                button7.Text = "Revoked";
                RisKeep = false;
            }
            else
            {
                button7.ForeColor = System.Drawing.Color.Green;
                button7.Text = "Keep";
                RisKeep = true;
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            if (DivisKeep == true)
            {
                button8.ForeColor = System.Drawing.Color.Red;
                button8.Text = "Revoked";
                DivisKeep = false;
            }
            else
            {
                button8.ForeColor = System.Drawing.Color.Green;
                button8.Text = "Keep";
                DivisKeep = true;
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            if (DvisKeep == true)
            {
                button9.ForeColor = System.Drawing.Color.Red;
                button9.Text = "Revoked";
                DvisKeep = false;
            }
            else
            {
                button9.ForeColor = System.Drawing.Color.Green;
                button9.Text = "Keep";
                DvisKeep = true;
            }
        }
        #endregion

        #region Calculate Time
        private void CalculateTime()
        {
            List<crime> callList = Crimes.GetList();
            preTime = 0;
            isBeingUsed = false;
            preCharges = "";
            calculated = false;

            if (checkBox1.Checked == true)
            {
                isDisabledDD = true;
            }
            else
            {
                isDisabledDD = false;
            }

            if (checkBox2.Checked == true)
            {
                isDisabledDop = true;
            }
            else
            {
                isDisabledDop = false;
            }


            if (numericUpDown3.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown3.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown3.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown3.Value.ToString() + ", ";
            }

            if (numericUpDown4.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown4.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown4.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown4.Value.ToString() + ", ";
            }

            if (numericUpDown5.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown5.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown5.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown5.Value.ToString() + ", ";
            }

            if (numericUpDown6.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown6.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown6.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown6.Value.ToString() + ", ";
            }

            if (numericUpDown7.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown7.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown7.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown7.Value.ToString() + ", ";
            }

            if (numericUpDown8.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown8.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown8.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown8.Value.ToString() + ", ";
            }

            if (numericUpDown9.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown9.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown9.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown9.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown10.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown10.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown10.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown10.Value.ToString() + ", ";
            }

            if (numericUpDown12.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown12.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown12.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown12.Value.ToString() + ", ";
            }

            if (numericUpDown13.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown13.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown13.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown13.Value.ToString() + ", ";
            }

            if (numericUpDown14.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown14.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown14.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown14.Value.ToString() + ", ";
            }

            if (numericUpDown15.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown15.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown15.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown15.Value.ToString() + ", ";
            }

            if (numericUpDown16.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown16.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown16.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown16.Value.ToString() + ", ";
            }

            if (numericUpDown17.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown17.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown17.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown17.Value.ToString() + ", ";
            }

            if (numericUpDown18.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown18.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown18.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown18.Value.ToString() + ", ";
            }

            if (numericUpDown19.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown19.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown19.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown19.Value.ToString() + ", ";
            }

            if (numericUpDown20.Value != 0 && isDisabledDop == true)
            {
                crime result = callList.Find(x => x.name == numericUpDown20.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown20.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown20.Value.ToString() + ", ";
            }

            if (numericUpDown22.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown22.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown22.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown22.Value.ToString() + ", ";
            }

            if (numericUpDown23.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown23.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown23.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown23.Value.ToString() + ", ";
            }

            if (numericUpDown24.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown24.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown24.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown24.Value.ToString() + ", ";
            }

            if (numericUpDown25.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown25.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown25.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown25.Value.ToString() + ", ";
            }

            if (numericUpDown26.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown26.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown26.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown26.Value.ToString() + ", ";
            }

            if (numericUpDown27.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown27.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown27.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown27.Value.ToString() + ", ";
            }

            if (numericUpDown28.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown28.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown28.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown28.Value.ToString() + ", ";
            }

            if (numericUpDown29.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown29.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown29.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown29.Value.ToString() + ", ";
            }

            if (numericUpDown30.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown30.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown30.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown30.Value.ToString() + ", ";
            }

            if (numericUpDown31.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown31.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown31.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown31.Value.ToString() + ", ";
            }

            if (numericUpDown32.Value != 0 && isDisabledDD == true)
            {
                crime result = callList.Find(x => x.name == numericUpDown32.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown32.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown32.Value.ToString() + ", ";
            }

            if (numericUpDown33.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown33.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown33.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown33.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown34.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown34.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown34.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown34.Value.ToString() + ", ";
            }

            if (numericUpDown35.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown35.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown35.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown35.Value.ToString() + ", ";
            }

            if (numericUpDown36.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown36.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown36.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown36.Value.ToString() + ", ";
            }

            if (numericUpDown37.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown37.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown37.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown37.Value.ToString() + ", ";
            }

            if (numericUpDown38.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown38.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown38.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown38.Value.ToString() + ", ";
            }

            if (numericUpDown40.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown40.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown40.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown40.Value.ToString() + ", ";
            }

            if (numericUpDown41.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown41.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown41.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown41.Value.ToString() + ", ";
            }

            if (numericUpDown42.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown42.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown42.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown42.Value.ToString() + ", ";
            }

            if (numericUpDown43.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown43.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown43.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown43.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown46.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown46.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown46.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown46.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown47.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown47.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown47.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown47.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown49.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown49.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown49.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown49.Value.ToString() + ", ";
            }

            if (numericUpDown50.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown50.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown50.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown50.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown51.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown51.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown51.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown51.Value.ToString() + ", ";
            }

            if (numericUpDown52.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown52.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown52.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown52.Value.ToString() + ", ";
            }

            if (numericUpDown54.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown54.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown54.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown54.Value.ToString() + ", ";
            }

            if (numericUpDown55.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown55.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown55.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown55.Value.ToString() + ", ";
            }

            if (numericUpDown56.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown56.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown56.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown56.Value.ToString() + ", ";
            }

            if (numericUpDown57.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown57.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown57.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown57.Value.ToString() + ", ";
            }

            if (numericUpDown60.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown60.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown60.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown60.Value.ToString() + ", ";
            }

            if (numericUpDown61.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown61.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown61.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown61.Value.ToString() + ", ";
            }

            if (numericUpDown62.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown62.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown62.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown62.Value.ToString() + ", ";
            }

            if (numericUpDown63.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown63.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown63.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown63.Value.ToString() + ", ";
            }

            if (numericUpDown65.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown65.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown65.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown65.Value.ToString() + ", ";
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (numericUpDown66.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown66.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown66.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown66.Value.ToString() + ", ";
            }

            if (numericUpDown67.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown67.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown67.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown67.Value.ToString() + ", ";
            }

            if (numericUpDown83.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown83.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown83.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown83.Value.ToString() + ", ";
            }

            if (numericUpDown1.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown1.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown1.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown1.Value.ToString() + ", ";
            }

            if (numericUpDown2.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown2.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown2.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown2.Value.ToString() + ", ";
            }

            if (numericUpDown11.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown11.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown11.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown11.Value.ToString() + ", ";
            }

            if (numericUpDown58.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown58.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown58.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown58.Value.ToString() + ", ";
            }

            if (numericUpDown59.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown59.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown59.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown59.Value.ToString() + ", ";
            }

            if (numericUpDown73.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown73.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown73.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown73.Value.ToString() + ", ";
            }

            if (numericUpDown69.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown69.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown69.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown69.Value.ToString() + ", ";
            }

            if (numericUpDown80.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown80.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown80.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown80.Value.ToString() + ", ";
            }

            if (numericUpDown81.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown81.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown81.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown81.Value.ToString() + ", ";
            }

            if (numericUpDown82.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown82.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown82.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown82.Value.ToString() + ", ";
                rlicense(DisKeep, button1);
            }

            if (numericUpDown84.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown84.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown84.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown84.Value.ToString() + ", ";
            }

            if (numericUpDown88.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown88.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown88.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown88.Value.ToString() + ", ";
            }

            if (numericUpDown89.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown89.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown89.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown89.Value.ToString() + ", ";
            }

            if (numericUpDown90.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown90.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown90.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown90.Value.ToString() + ", ";
            }

            if (numericUpDown91.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown91.Tag);
                Debug.WriteLine(result.name.ToString());
                int jailTime = result.jailTime;
                Debug.WriteLine(result.name + " " + jailTime);
                preTime = preTime + (Decimal.ToInt32(numericUpDown91.Value) * jailTime);
                preCharges = preCharges + result.name + " x" + numericUpDown91.Value.ToString() + ", ";
            }


            if (numericUpDown86.Value != 0)
            {
                preTime = preTime + Decimal.ToInt32(numericUpDown86.Value);
            }

            if (checkBox3.Checked == true)
            {
                preTime = preTime * 1.25f;
            }

            if (checkBox5.Checked == true)
            {
                rlicense(RisKeep, button7);
                rlicense(PisisKeep, button6);
                isBeingUsed = true;
            }

            if (checkBox4.Checked == true)
            {
                preTime = (preFines / 100) + 5f;
            }

            if (checkBox6.Checked == true)
            {
                preTime = preTime + 35;
            }

            if (isBeingUsed == false)
            {
                klicense(RisKeep, button7);
                klicense(PisisKeep, button6);
            }

            preTimeI = Convert.ToInt32(preTime);

            int hours = preTimeI / 60;
            int minutes = preTimeI % 60;
            textBox1.Text = hours.ToString() + " Hours " + minutes.ToString() + " Minutes";
            CalculateFines();
        }
        #endregion

        #region Calculate Fines
        private void CalculateFines()
        {
            List<crime> callList = Crimes.GetList();
            calcFines = true;
            preFines = 0;
            calculated = false;

            if (numericUpDown68.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown68.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown68.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown68.Value.ToString() + ", ";
            }

            if (numericUpDown69.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown69.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown69.Value) * fines);
            }

            if (numericUpDown77.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown77.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown77.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown77.Value.ToString() + ", ";
            }

            if (numericUpDown71.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown71.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown71.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown71.Value.ToString() + ", ";
            }

            if (numericUpDown72.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown72.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown72.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown72.Value.ToString() + ", ";
            }

            if (numericUpDown74.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown74.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown74.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown74.Value.ToString() + ", ";
            }

            if (numericUpDown75.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown75.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown75.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown75.Value.ToString() + ", ";
            }

            if (numericUpDown76.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown76.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown76.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown76.Value.ToString() + ", ";
            }

            if (numericUpDown78.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown78.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown78.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown78.Value.ToString() + ", ";
            }

            if (numericUpDown79.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown79.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown79.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown79.Value.ToString() + ", ";
            }

            if (numericUpDown81.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown81.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown81.Value) * fines);
            }

            if (numericUpDown20.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown20.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown20.Value) * fines);
            }

            if (numericUpDown64.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown64.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown64.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown64.Value.ToString() + ", ";
            }

            if (numericUpDown21.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown21.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown21.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown21.Value.ToString() + ", ";
            }

            if (numericUpDown25.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown25.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown25.Value) * fines);
            }

            if (numericUpDown27.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown27.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown27.Value) * fines);
            }

            if (numericUpDown29.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown29.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown29.Value) * fines);
            }

            if (numericUpDown70.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown70.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown70.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown70.Value.ToString() + ", ";
            }

            if (numericUpDown32.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown32.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown32.Value) * fines);
            }

            if (numericUpDown39.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown39.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown39.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown39.Value.ToString() + ", ";
            }

            if (numericUpDown34.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown34.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown34.Value) * fines);
            }

            if (numericUpDown41.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown41.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown41.Value) * fines);
            }

            if (numericUpDown44.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown44.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown44.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown44.Value.ToString() + ", ";
            }

            if (numericUpDown45.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown45.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown45.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown45.Value.ToString() + ", ";
            }

            if (numericUpDown48.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown48.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown48.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown48.Value.ToString() + ", ";
            }

            if (numericUpDown53.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown53.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown53.Value) * fines);
                preCharges = preCharges + result.name + " x" + numericUpDown53.Value.ToString() + ", ";
            }

            if (numericUpDown5.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown5.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown5.Value) * fines);
            }

            if (numericUpDown19.Value != 0)
            {
                crime result = callList.Find(x => x.name == numericUpDown19.Tag);
                Debug.WriteLine(result.name.ToString());
                int fines = result.fines;
                Debug.WriteLine(result.name + " " + fines);
                preFines = preFines + (Decimal.ToInt32(numericUpDown19.Value) * fines);
            }

            if (numericUpDown87.Value != 0)
            {
                preFines = preFines + Decimal.ToInt32(numericUpDown87.Value);
            }

            if (numericUpDown85.Value != 0)
            {
                preFines = preFines + Decimal.ToInt32(numericUpDown85.Value);
            }

            if (checkBox4.Checked == true)
            {
                preFines = 0;
            }

            textBox2.Text = "$" + preFines.ToString();
            processCharges();
        }
        #endregion

        #region Process Charges
        void processCharges()
        {
                if (button1.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Drivers License";
                }

                if (button2.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Motorcycle License";
                }

                if (button3.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Truck License";
                }

                if (button4.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Boat License";
                }

                if (button5.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Pilot License";
                }

                if (button6.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Pistol License";
                }

                if (button7.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Rifle License";
                }

                if (button8.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Divers License";
                }

                if (button9.Text == "Revoked")
                {
                    preCharges = preCharges + " | " + "Revoke Divers Vehicle License";
                }

                textBox3.Text = preCharges;
        }
        #endregion

        void rlicense(bool isKeepBool, Button button)
        {
            isKeepBool = false;
            button.ForeColor = System.Drawing.Color.Red;
            button.Text = "Revoked";
        }

        void klicense(bool isKeepBool, Button button)
        {
            isKeepBool = true;
            button.ForeColor = System.Drawing.Color.Green;
            button.Text = "Keep";
        }

        private void button10_Click(object sender, EventArgs e)
        {
            CalculateTime();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {

        }

        #region Tool Button Functions
        private void button11_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(textBox1.Text);
        }

        private void button12_Click(object sender, EventArgs e)
        {
            if (textBox3.Text != "")
            {
                Clipboard.SetText(textBox3.Text);
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            Clipboard.SetText(textBox2.Text + " In Fines");
        }

        private void button14_Click(object sender, EventArgs e)
        {
            textBox3.Text = "Does Not Work!";
            textBox2.Text = "Does Not Work!";
            textBox1.Text = "Does Not Work!";
        }
        #endregion

        private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {
        
        }

        private void label110_Click(object sender, EventArgs e)
        {

        }

        private void label111_Click(object sender, EventArgs e)
        {

        }

        #region Dispatch Tab
        private void button15_Click(object sender, EventArgs e)
        {
            comboBox1.Text = "Status...";
            textBox4.Text = "Officer 1";
            textBox5.Text = "Officer 2"; 
            textBox6.Text = "";
        }

        private void button16_Click(object sender, EventArgs e)
        {
            comboBox2.Text = "Status...";
            textBox7.Text = "Officer 1";
            textBox8.Text = "Officer 2";
            textBox9.Text = "";
        }

        private void button17_Click(object sender, EventArgs e)
        {
            comboBox3.Text = "Status...";
            textBox10.Text = "Officer 1";
            textBox11.Text = "Officer 2";
            textBox12.Text = "";
        }

        private void button18_Click(object sender, EventArgs e)
        {
            comboBox4.Text = "Status..."; 
            textBox13.Text = "Officer 1";
            textBox14.Text = "Officer 2";
            textBox15.Text = "";
        }

        private void button19_Click(object sender, EventArgs e)
        {
            comboBox5.Text = "Status...";
            textBox16.Text = "Officer 1";
            textBox17.Text = "Officer 2";
            textBox18.Text = "";
        }

        private void button20_Click(object sender, EventArgs e)
        {
            comboBox6.Text = "Status...";
            textBox19.Text = "Officer 1";
            textBox20.Text = "Officer 2";
            textBox21.Text = "";
        }

        private void button21_Click(object sender, EventArgs e)
        {
            comboBox7.Text = "Status...";
            textBox22.Text = "Officer 1";
            textBox23.Text = "Officer 2";
            textBox24.Text = "";
        }

        private void button22_Click(object sender, EventArgs e)
        {
            comboBox8.Text = "Status...";
            textBox25.Text = "Officer 1";
            textBox26.Text = "Officer 2";
            textBox27.Text = "";
        }

        private void button23_Click(object sender, EventArgs e)
        {
            comboBox9.Text = "Status...";
            textBox28.Text = "Officer 1";
            textBox29.Text = "Officer 2";
            textBox30.Text = "";
        }

        private void button24_Click(object sender, EventArgs e)
        {
            comboBox10.Text = "Status...";
            textBox31.Text = "Officer 1";
            textBox32.Text = "Officer 2";
            textBox33.Text = "";
        }

        private void button25_Click(object sender, EventArgs e)
        {
            comboBox11.Text = "Status...";
            textBox34.Text = "Officer 1";
            textBox35.Text = "Officer 2";
            textBox36.Text = "";
        }

        private void button26_Click(object sender, EventArgs e)
        {
            comboBox12.Text = "Status...";
            textBox37.Text = "Officer 1";
            textBox38.Text = "Officer 2";
            textBox39.Text = "";
        }

        private void button27_Click(object sender, EventArgs e)
        {
            comboBox13.Text = "Status...";
            textBox40.Text = "Officer 1";
            textBox41.Text = "Officer 2";
            textBox42.Text = "";
        }

        private void button28_Click(object sender, EventArgs e)
        {
            comboBox14.Text = "Status...";
            textBox43.Text = "Officer 1";
            textBox44.Text = "Officer 2";
            textBox45.Text = "";
        }

        private void button29_Click(object sender, EventArgs e)
        {
            comboBox15.Text = "Status...";
            textBox46.Text = "Officer 1";
            textBox47.Text = "Officer 2";
            textBox48.Text = "";
        }

        private void button30_Click(object sender, EventArgs e)
        {
            comboBox16.Text = "Status...";
            textBox49.Text = "Officer 1";
            textBox50.Text = "Officer 2";
            textBox51.Text = "";
        }
        #endregion

        #region SharpUpdate
        public string ApplicationName
        {
            get { return "CLPD Calculator"; }
        }

        public string ApplicationID
        {
            get { return "CLPD Calculator"; }
        }

        public Assembly ApplicationAssembly
        {
            get { return Assembly.GetExecutingAssembly(); }
        }

        public Icon ApplicationIcon
        {
            get { return this.Icon; }
        }

        public Uri UpdateXmlLocation
        {
            get { return new Uri("http://www.clpdtools.net84.net/clpdcalc/update.xml"); }
        }

        public Form Context
        {
            get { return this; }
        }

        private void button31_Click(object sender, EventArgs e)
        {
            updater.DoUpdate();
        }
        #endregion


    }
}
